#!/bin/sh

# shows the result of the actions done by actions-dcadmin

RESULTS=/tmp/dcadmin.results

LOOP=1

while test $LOOP -gt 0
do

  if test -f $RESULTS.ready
  then

    cat $RESULTS
    LOOP=0
    rm -f $RESULTS
    rm -f $RESULTS.ready

  else

    LOOP=$((LOOP + 1))
    sleep 1

    if test $LOOP -gt 10
    then
      echo "ERROR: process did not finish in time."  
      echo "The action may complete later but it's"
      echo "very likely that something went wrong."
      LOOP=0
    fi
 
  fi

done
